package actionmodel.factory_pattern.SimpleDemo;

/**
 * @Author yangjin
 * @Description
 * @Date 2021/12/9/17:38
 **/
public class FactoryPatternTestDemo {
    public static void main(String[] args) {
        FruitFactory fruitFactory = new FruitFactory();

        Fruit apple = fruitFactory.buyFruit(FruitFactory.APPLE);
        apple.buyFruit();

        Fruit banana = fruitFactory.buyFruit(FruitFactory.BANANA);
        banana.buyFruit();

        Fruit waterMelon = fruitFactory.buyFruit(FruitFactory.WATERMELON);
        waterMelon.buyFruit();
    }
}
